'''
功能测试模块
'''


import subprocess
from subprocess import PIPE
from setting import *
from control_test import stop_pid
import sys



def test_pid(name):
    # 查询该进程是否存在
    p_check = subprocess.Popen('ps aux | grep %s' % name, shell=True, stdout=subprocess.PIPE)
    print(p_check.stdout.readlines())

def test_name():
    # 查询该进程是否存在
    p_check = subprocess.Popen("ps aux | grep %s" % CMD, shell=True, stdout=subprocess.PIPE)
    if len(p_check.stdout.readlines()) < 2:
        print(p_check.stdout.readlines())
        print('no')
        return False
    else:
        print('yes')
        return True

if __name__ == '__main__':
    list1 = sys.argv
    stop_pid(list1[1])
